import request from "./gocliRequest";
import * as components from "./clientComponents";
export * from "./clientComponents";

/**
 * @description "login"
 * @param req
 */
export function login(req: components.BsUserLoginReq) {
  return request.post<components.BsUserLoginResp>(
    `/client/auth/v1/user/login`,
    req
  );
}

/**
 * @description "refreshToken"
 * @param params
 */
export function refreshToken(params: components.BsRefreshTokenReqParams) {
  return request.get<components.BsUserLoginResp>(
    `/client/auth/v1/user/refreshToken`,
    params
  );
}

/**
 * @description "定时将未分配的用户自动分配给组长"
 */
export function addUserToGroupScheduledTasks() {
  return request.post<components.AddUserToGroupScheduledTasksResp>(
    `/client/open/v1/addUserToGroupScheduledTasks`
  );
}

/**
 * @description "添加房源,接收爬虫数据"
 * @param req
 */
export function addHomelistingsTheCrawler(
  req: components.AddHomelistingsCrawlerReq
) {
  return request.post<components.AddHomelistingsCrawlerResp>(
    `/client/open/v1/business/addHomelistingsTheCrawler`,
    req
  );
}

/**
 * @description "添加房源,接收爬虫数据"
 */
export function updateHomelistingsAuctionStatus() {
  return request.post<components.UpdateHomelistingsAuctionStatusResp>(
    `/client/open/v1/business/updateHomelistingsAuctionStatus`
  );
}

/**
 * @description "查询未爬到图片的房源id"
 */
export function getHomelistingsNoImgtpId() {
  return request.post<components.GetHomelistingsNoImgtpIdResp>(
    `/client/open/v1/getHomelistingsNoImgtpId`
  );
}

/**
 * @description "根据tpid更新房源图片"
 * @param req
 */
export function updateHomelistingsImgtpId(
  req: components.UpdateHomelistingsImgtpIdReq
) {
  return request.post<components.UpdateHomelistingsImgtpIdResp>(
    `/client/open/v1/updateHomelistingsImgtpId`,
    req
  );
}

/**
 * @description "获取爬虫cookie"
 */
export function getSpiderCookies() {
  return request.post<components.GetSpiderCookiesResp>(
    `/client/spider/v1/getSpiderCookies`
  );
}

/**
 * @description "获取爬虫状态"
 */
export function getSpiderStatus() {
  return request.post<components.GetSpiderStatusResp>(
    `/client/spider/v1/getSpiderStatus`
  );
}

/**
 * @description "设置爬虫cookie"
 * @param req
 */
export function setSpiderCookies(req: components.SetSpiderCookiesReq) {
  return request.post<components.SetSpiderCookiesResp>(
    `/client/spider/v1/setSpiderCookies`,
    req
  );
}

/**
 * @description "启动爬虫"
 */
export function spiderRun() {
  return request.post<components.SpiderRunResp>(`/client/spider/v1/spiderRun`);
}

/**
 * @description "我要买房"
 * @param req
 */
export function addBuyerInfo(req: components.AddBuyerInfoReq) {
  return request.post<components.AddBuyerInfoResp>(
    `/client/users/v1/business/addBuyerInfo`,
    req
  );
}

/**
 * @description "添加收藏的房源"
 * @param req
 */
export function addCollectionHousing(req: components.AddCollectionHousingReq) {
  return request.post<components.AddCollectionHousingResp>(
    `/client/users/v1/business/addCollectionHousing`,
    req
  );
}

/**
 * @description "添加投诉建议"
 * @param req
 */
export function addComplaint(req: components.AddComplaintReq) {
  return request.post<components.AddComplaintResp>(
    `/client/users/v1/business/addComplaint`,
    req
  );
}

/**
 * @description "添加合作咨询"
 * @param req
 */
export function addCooperation(req: components.AddCooperationReq) {
  return request.post<components.AddCooperationResp>(
    `/client/users/v1/business/addCooperation`,
    req
  );
}

/**
 * @description "添加房源"
 * @param req
 */
export function addHomelistings(req: components.AddHomelistingsReq) {
  return request.post<components.AddHomelistingsResp>(
    `/client/users/v1/business/addHomelistings`,
    req
  );
}

/**
 * @description "我要卖房"
 * @param req
 */
export function addSellerInfo(req: components.AddSellerInfoReq) {
  return request.post<components.AddSellerInfoResp>(
    `/client/users/v1/business/addSellerInfo`,
    req
  );
}

/**
 * @description "添加工作流程"
 * @param req
 */
export function addWorkflow(req: components.AddWorkflowReq) {
  return request.post<components.AddWorkflowResp>(
    `/client/users/v1/business/addWorkflow`,
    req
  );
}

/**
 * @description "添加一个流程进度"
 * @param req
 */
export function addWorkflowSchedule(req: components.AddWorkflowScheduleReq) {
  return request.post<components.AddWorkflowScheduleResp>(
    `/client/users/v1/business/addWorkflowSchedule`,
    req
  );
}

/**
 * @description "批量下架房源"
 * @param req
 */
export function batchOfflineHomelistings(
  req: components.BatchOfflineHomelistingsReq
) {
  return request.post<components.BatchOfflineHomelistingsResp>(
    `/client/users/v1/business/batchOfflineHomelistings`,
    req
  );
}

/**
 * @description "处理投诉"
 * @param req
 */
export function dealComplaint(req: components.DealComplaintReq) {
  return request.post<components.DealComplaintResp>(
    `/client/users/v1/business/dealComplaint`,
    req
  );
}

/**
 * @description "删除收藏的房源"
 * @param req
 */
export function deleteCollectionHousing(
  req: components.DeleteCollectionHousingReq
) {
  return request.post<components.DeleteCollectionHousingResp>(
    `/client/users/v1/business/deleteCollectionHousing`,
    req
  );
}

/**
 * @description "删除投诉建议"
 * @param req
 */
export function deleteComplaint(req: components.DeleteComplaintReq) {
  return request.post<components.DeleteComplaintResp>(
    `/client/users/v1/business/deleteComplaint`,
    req
  );
}

/**
 * @description "删除房源"
 * @param req
 */
export function deleteHomelistings(req: components.DeleteHomelistingsReq) {
  return request.post<components.DeleteHomelistingsResp>(
    `/client/users/v1/business/deleteHomelistings`,
    req
  );
}

/**
 * @description "删除工作流程"
 * @param req
 */
export function deleteWorkflow(req: components.DeleteWorkflowReq) {
  return request.post<components.DeleteWorkflowResp>(
    `/client/users/v1/business/deleteWorkflow`,
    req
  );
}

/**
 * @description "删除一个流程进度"
 * @param req
 */
export function deleteWorkflowSchedule(
  req: components.DeleteWorkflowScheduleReq
) {
  return request.post<components.DeleteWorkflowScheduleResp>(
    `/client/users/v1/business/deleteWorkflowSchedule`,
    req
  );
}

/**
 * @description
 * @param req
 */
export function endWorkflow(req: components.EndWorkflowReq) {
  return request.post<components.EndWorkflowResp>(
    `/client/users/v1/business/endWorkflow`,
    req
  );
}

/**
 * @description "查询区的所有房源"
 * @param req
 */
export function getAreaHomelistingsByCityList(
  req: components.GetAreaHomelistingsByCityListReq
) {
  return request.post<components.GetAreaHomelistingsByCityListResp>(
    `/client/users/v1/business/getAreaHomelistingsByCityList`,
    req
  );
}

/**
 * @description "查询我要买房列表"
 * @param req
 */
export function getBuyerInfoList(req: components.GetBuyerInfoListReq) {
  return request.post<components.GetBuyerInfoListResp>(
    `/client/users/v1/business/getBuyerInfoList`,
    req
  );
}

/**
 * @description "查询收藏的房源"
 * @param req
 */
export function getCollectionHousingList(
  req: components.GetCollectionHousingListReq
) {
  return request.post<components.GetCollectionHousingListResp>(
    `/client/users/v1/business/getCollectionHousingList`,
    req
  );
}

/**
 * @description "查询小区的所有房源"
 * @param req
 */
export function getCommunityHomelistingsByCityList(
  req: components.GetCommunityHomelistingsByCityListReq
) {
  return request.post<components.GetCommunityHomelistingsByCityListResp>(
    `/client/users/v1/business/getCommunityHomelistingsByCityList`,
    req
  );
}

/**
 * @description "查询投诉建议"
 * @param req
 */
export function getComplaintList(req: components.GetComplaintListReq) {
  return request.post<components.GetComplaintListResp>(
    `/client/users/v1/business/getComplaintList`,
    req
  );
}

/**
 * @description "查询合作咨询列表"
 * @param req
 */
export function getCooperationList(req: components.GetCooperationListReq) {
  return request.post<components.GetCooperationListResp>(
    `/client/users/v1/business/getCooperationList`,
    req
  );
}

/**
 * @description "根据id查询卖方信息"
 * @param req
 */
export function getHomelistingInfoById(
  req: components.GetHomelistingInfoByIdReq
) {
  return request.post<components.HomelistingsInfo>(
    `/client/users/v1/business/getHomelistingInfoById`,
    req
  );
}

/**
 * @description "查询房源列表"
 * @param req
 */
export function getHomelistingsList(req: components.GetHomelistingsListReq) {
  return request.post<components.GetHomelistingsListResp>(
    `/client/users/v1/business/getHomelistingsList`,
    req
  );
}

/**
 * @description "根据用户id查询卖方信息"
 * @param req
 */
export function getSellerInfoByUserId(
  req: components.GetSellerInfoByUserIdReq
) {
  return request.post<components.GetSellerInfoByUserIdResp>(
    `/client/users/v1/business/getSellerInfoByUserId`,
    req
  );
}

/**
 * @description "查询我要卖方列表"
 * @param req
 */
export function getSellerInfoList(req: components.GetSellerInfoListReq) {
  return request.post<components.GetSellerInfoListResp>(
    `/client/users/v1/business/getSellerInfoList`,
    req
  );
}

/**
 * @description "查询流程列表"
 * @param req
 */
export function getWorkflowList(req: components.GetWorkflowListReq) {
  return request.post<components.GetWorkflowListResp>(
    `/client/users/v1/business/getWorkflowList`,
    req
  );
}

/**
 * @description "根据流程id查询流程进度"
 * @param req
 */
export function getWorkflowScheduleByWorkFlowId(
  req: components.GetWorkflowScheduleByWorkFlowIdReq
) {
  return request.post<components.GetWorkflowScheduleByWorkFlowIdResp>(
    `/client/users/v1/business/getWorkflowScheduleByWorkFlowId`,
    req
  );
}

/**
 * @description "首页的统计"
 * @param req
 */
export function homeStatistics(req: components.HomeStatisticsReq) {
  return request.post<components.HomeStatisticsResp>(
    `/client/users/v1/business/homeStatistics`,
    req
  );
}

/**
 * @description "房源上架或下架，0-下架；1-上架"
 * @param req
 */
export function setHomelistingOnlineAndOffline(
  req: components.SetHomelistingOnlineAndOfflineReq
) {
  return request.post<components.SetHomelistingOnlineAndOfflineResp>(
    `/client/users/v1/business/setHomelistingOnlineAndOffline`,
    req
  );
}

/**
 * @description "修改房源"
 * @param req
 */
export function updateHomelistings(req: components.UpdateHomelistingsReq) {
  return request.post<components.UpdateHomelistingsResp>(
    `/client/users/v1/business/updateHomelistings`,
    req
  );
}

/**
 * @description "修改工作流程"
 * @param req
 */
export function updateWorkflow(req: components.UpdateWorkflowReq) {
  return request.post<components.UpdateWorkflowResp>(
    `/client/users/v1/business/updateWorkflow`,
    req
  );
}

/**
 * @description "修改流程进度"
 * @param req
 */
export function updateWorkflowSchedule(
  req: components.UpdateWorkflowScheduleReq
) {
  return request.post<components.UpdateWorkflowScheduleResp>(
    `/client/users/v1/business/updateWorkflowSchedule`,
    req
  );
}

/**
 * @description "getOrSetRedis"
 * @param req
 */
export function getOrSetRedis(req: components.GetOrSetRedisReq) {
  return request.post<components.GetOrSetRedisResp>(
    `/client/users/v1/getOrSetRedis`,
    req
  );
}

/**
 * @description "添加广告"
 * @param req
 */
export function addAdvertising(req: components.AddAdvertisingReq) {
  return request.post<components.AddAdvertisingResp>(
    `/client/users/v1/system/addAdvertising`,
    req
  );
}

/**
 * @description "新增房贷利率"
 * @param req
 */
export function addInterestrate(req: components.AddInterestrateReq) {
  return request.post<components.AddInterestrateResp>(
    `/client/users/v1/system/addInterestrate`,
    req
  );
}

/**
 * @description "删除广告"
 * @param req
 */
export function deleteAdvertising(req: components.DeleteAdvertisingReq) {
  return request.post<components.DeleteAdvertisingResp>(
    `/client/users/v1/system/deleteAdvertising`,
    req
  );
}

/**
 * @description "删除房贷利率"
 * @param req
 */
export function deleteInterestrate(req: components.DeleteInterestrateReq) {
  return request.post<components.DeleteInterestrateResp>(
    `/client/users/v1/system/deleteInterestrate`,
    req
  );
}

/**
 * @description "查询广告列表"
 * @param req
 */
export function getAdvertisingList(req: components.GetAdvertisingListReq) {
  return request.post<components.GetAdvertisingListResp>(
    `/client/users/v1/system/getAdvertisingList`,
    req
  );
}

/**
 * @description "查询房贷利率列表"
 * @param req
 */
export function getInterestrateList(req: components.GetInterestrateListReq) {
  return request.post<components.GetInterestrateListResp>(
    `/client/users/v1/system/getInterestrateList`,
    req
  );
}

/**
 * @description "修改广告"
 * @param req
 */
export function updateAdvertising(req: components.UpdateAdvertisingReq) {
  return request.post<components.UpdateAdvertisingResp>(
    `/client/users/v1/system/updateAdvertising`,
    req
  );
}

/**
 * @description "修改房贷利率"
 * @param req
 */
export function updateInterestrate(req: components.UpdateInterestrateReq) {
  return request.post<components.UpdateInterestrateResp>(
    `/client/users/v1/system/updateInterestrate`,
    req
  );
}

/**
 * @description "将客户分配给用户"
 * @param req
 */
export function addUserToHouse(req: components.AddUserToHouseReq) {
  return request.post<components.AddUserToHouseResp>(
    `/client/users/v1/user/addUserToHouse`,
    req
  );
}

/**
 * @description "将用户加入到待分配的用户表"
 * @param req
 */
export function addUserToWaitUser(req: components.AddUserToWaitUserReq) {
  return request.post<components.AddUserToWaitUserResp>(
    `/client/users/v1/user/addUserToWaitUser`,
    req
  );
}

/**
 * @description "绑定用户成推广人员"
 * @param req
 */
export function bindUser(req: components.BindUserReq) {
  return request.post<components.BindUserResp>(
    `/client/users/v1/user/bindUser`,
    req
  );
}

/**
 * @description "绑定用户访问的房源"
 * @param req
 */
export function bindUserToHomelistings(
  req: components.BindUserToHomelistingsReq
) {
  return request.post<components.BindUserToHomelistingsResp>(
    `/client/users/v1/user/bindUserToHomelistings`,
    req
  );
}

/**
 * @description "生成推广二维码"
 * @param req
 */
export function createPromoterQrCode(req: components.CreatePromoterQrCodeReq) {
  return request.post<components.CreatePromoterQrCodeResp>(
    `/client/users/v1/user/createPromoterQrCode`,
    req
  );
}

/**
 * @description "查询所有的组长"
 * @param req
 */
export function getAllGroupUser(req: components.GetAllGroupUserReq) {
  return request.post<components.GetAllGroupUserResp>(
    `/client/users/v1/user/getAllGroupUser`,
    req
  );
}

/**
 * @description "获取用户列表"
 * @param req
 */
export function getBsUserList(req: components.GetBsUserListReq) {
  return request.post<components.GetBsUserListResp>(
    `/client/users/v1/user/getBsUserList`,
    req
  );
}

/**
 * @description "查询我推荐的用户"
 * @param req
 */
export function getRecommendedUserList(
  req: components.GetRecommendedUserListReq
) {
  return request.post<components.GetRecommendedUserListResp>(
    `/client/users/v1/user/getRecommendedUserList`,
    req
  );
}

/**
 * @description "销售业绩"
 * @param req
 */
export function getStatisticalSalesPerformance(
  req: components.GetStatisticalSalesPerformanceReq
) {
  return request.post<components.GetStatisticalSalesPerformanceResp>(
    `/client/users/v1/user/getStatisticalSalesPerformance`,
    req
  );
}

/**
 * @description "获取用户绑定的手机"
 * @param req
 */
export function getUserBindPhone(req: components.GetUserBindPhoneReq) {
  return request.post<components.GetUserBindPhoneResp>(
    `/client/users/v1/user/getUserBindPhone`,
    req
  );
}

/**
 * @description "getUserInfo"
 */
export function getUserInfo() {
  return request.get<components.GetBsUserInfoResp>(
    `/client/users/v1/user/getUserInfo`
  );
}

/**
 * @description "根据主键id查询分配记录"
 * @param req
 */
export function getUserToHouseContactRecordById(
  req: components.GetUserToHouseContactRecordByIdReq
) {
  return request.post<components.WaitUserInfo>(
    `/client/users/v1/user/getUserToHouseContactRecordById`,
    req
  );
}

/**
 * @description "查询用户的专属顾问"
 * @param req
 */
export function getUserToHouseContactRecordByUserId(
  req: components.GetUserToHouseContactRecordByUserIdReq
) {
  return request.post<components.SysUserItem>(
    `/client/users/v1/user/getUserToHouseContactRecordByUserId`,
    req
  );
}

/**
 * @description "查询待分配用户列表"
 * @param req
 */
export function getWaitUserList(req: components.GetWaitUserListReq) {
  return request.post<components.GetWaitUserListResp>(
    `/client/users/v1/user/getWaitUserList`,
    req
  );
}

/**
 * @description "查询待分配列表绑定的房源"
 * @param req
 */
export function getWaitUserListBindHouse(
  req: components.GetWaitUserListBindHouseReq
) {
  return request.post<components.GetWaitUserListBindHouseResp>(
    `/client/users/v1/user/getWaitUserListBindHouse`,
    req
  );
}

/**
 * @description "推荐新用户"
 * @param req
 */
export function recommendNewUsers(req: components.RecommendNewUsersReq) {
  return request.post<components.RecommendNewUsersResp>(
    `/client/users/v1/user/recommendNewUsers`,
    req
  );
}

/**
 * @description "更新用户信息"
 * @param req
 */
export function updateBsUserInfo(req: components.UpdateBsUserInfoReq) {
  return request.post<components.UpdateBsUserInfoResp>(
    `/client/users/v1/user/updateBsUserInfo`,
    req
  );
}

/**
 * @description "已经联系客户"
 * @param req
 */
export function updateUserToHouseContact(
  req: components.UpdateUserToHouseContactReq
) {
  return request.post<components.UpdateUserToHouseContactResp>(
    `/client/users/v1/user/updateUserToHouseContact`,
    req
  );
}

/**
 * @description "更新沟通记录"
 * @param req
 */
export function updateUserToHouseContactRecord(
  req: components.UpdateUserToHouseContactRecordReq
) {
  return request.post<components.UpdateUserToHouseContactRecordResp>(
    `/client/users/v1/user/updateUserToHouseContactRecord`,
    req
  );
}

/**
 * @description "更改待分配列表的组长"
 * @param req
 */
export function updateWaitUserLeader(req: components.UpdateWaitUserLeaderReq) {
  return request.post<components.UpdateWaitUserLeaderResp>(
    `/client/users/v1/user/updateWaitUserLeader`,
    req
  );
}
